// 处理 ResizeObserver 循环限制
export function handleResizeObserverLoopError() {
  const resizeHandler = () => {
    const messages = [
      'ResizeObserver loop completed with undelivered notifications.',
      'ResizeObserver loop limit exceeded'
    ]
    
    const originalError = window.console.error
    window.console.error = (...args) => {
      if (!messages.some(msg => args.toString().includes(msg))) {
        originalError.call(window.console, ...args)
      }
    }
  }

  window.addEventListener('load', resizeHandler)
  return () => window.removeEventListener('load', resizeHandler)
} 